package com.yumeko.dubbo.controller;

import com.yumeko.dubbo.pojo.User;
import com.yumeko.dubbo.service.PrividerMessageService;
import com.yumeko.dubbo.service.RemoteUserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "start")
public class RabbitmqController {
    @Reference(version="${dubbo.version}")
    private PrividerMessageService prividerMessageService;

    @RequestMapping(value = "rabbitmq")
    @ResponseBody
    public String RemoteUser(@RequestParam("name") String name,@RequestParam("age") String age){
        User user = new User();
        user.setName("name");
        user.setAge("age");
       return prividerMessageService.consume(user);
    }
}
